﻿@using CoreData
@model List<Article>
@{
    var firstItem = Model.FirstOrDefault();
    var ListArticle = Model.Where(x => x.ID != firstItem.ID);
}
@if (Model != null && Model.Count() > 0)
{
    <div class="grid-view grid-article">
        <div class="grid-title">
            <h3>
                Bài viết</h3>
            <div class="link-to-all">
                <a href="@Url.RouteUrl("articles_list")" target="_blank">Xem thêm »</a>
            </div>
        </div>
        <div class="col-small">
            <div class="news-thumb">
                <div class="large-thumbnail">
                    <a href="@Url.RouteUrl("article_details", new { Id = firstItem.ID, Link = firstItem.Link })">
                        <img src="/Media/Article/@firstItem.Image" alt="@firstItem.Image"></a>
                </div>
                <div class="row-content">
                    <h2 class="title">
                    @{
    var FirstDescription = @firstItem.ShortDescription;
    if (FirstDescription.Length > 100) {
        FirstDescription = FirstDescription.Substring(0, 100) + "...";
    }
                        }
                        <a href="@Url.RouteUrl("article_details", new { Id = firstItem.ID, Link = firstItem.Link })" title="@firstItem.Title">@firstItem.Title</a></h2>
                    <span class="description">@FirstDescription</span> <a class="link-more"
                        href="@Url.RouteUrl("article_details", new { Id = firstItem.ID, Link = firstItem.Link })">
                        Chi tiết »</a>
                </div>
            </div>
        </div>
        <div class="col-content">
            <div class="news-list-module">
                @if (ListArticle != null && ListArticle.Count() > 0)
                {
                    <ul>
                        @foreach (var item in ListArticle)
                        {
                            var Title = item.Title;
                            if (Title.Length > 75) {
                                Title = Title.Substring(0, 72) + "...";
                            }
                            <li class="row-item">
                                <div class="row-content">
                                    <h2 class="title">
                                        <label>
                                            &#65515;</label><a href="@Url.RouteUrl("article_details", new { Id = item.ID, Link = item.Link })" title="@item.Title">@Title</a></h2>
                                    <a class="link-more" href="@Url.RouteUrl("article_details", new { Id = firstItem.ID, Link = firstItem.Link })">Chi tiết »</a>
                                </div>
                            </li>
                        }
                    </ul>
                }
            </div>
        </div>
        <div class="clearfix">
        </div>
    </div>
}